package filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

//@WebFilter(value={"/one","/two"})
//@WebFilter("/one")
public class AOneFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

        System.out.println("过滤器被创建====>>>");

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

        System.out.println("请求正进行过滤====>>>one");

        //放行给下一个过滤器使用(***********)
        filterChain.doFilter(servletRequest,servletResponse);

        System.out.println("响应返回过滤器中进行返回=====>>one");


    }

    @Override
    public void destroy() {
        System.out.println("过滤器被销毁====>>>");

    }
}
